package park.manage;

import javax.swing.*;
import java.awt.*;

public class MyJDialog {
    String title="";
    public MyJDialog(){

    }
    public MyJDialog(String content, int width, int height, boolean alwaysTop, boolean modal, String title, Color fontColor){
        this.title=title;
        JDialog jDialog = new JDialog();
        jDialog.setTitle(title);
        jDialog.setSize(width, height);
        jDialog.setAlwaysOnTop(alwaysTop);
        jDialog.setLocationRelativeTo(null);
        jDialog.setModal(modal);
        JLabel label = new JLabel(content);
        label.setFont(new Font("微软雅黑",Font.PLAIN,15));
        label.setForeground(fontColor);
        label.setBounds(0,0,200,150);
        jDialog.getContentPane().add(label);
        jDialog.setVisible(true);
}
    public MyJDialog(ImageIcon image, int width, int height, boolean alwaysTop, boolean modal, String title){
        JDialog jDialog = new JDialog();
        jDialog.setTitle(title);
        jDialog.setAlwaysOnTop(alwaysTop);
        jDialog.setSize(width, height);
        jDialog.setLocationRelativeTo(null);
        jDialog.setModal(modal);
        JLabel label = new JLabel(image);
        label.setBounds(0,0,258,216);
        jDialog.getContentPane().add(label);
        jDialog.setVisible(true);
    }
}
